﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

[Serializable]
public class InitData
{
    public long id;
    /// <summary>
    /// 招募一次消耗
    /// </summary>
    public int recruit_rmb_once;
    /// <summary>
    /// 招募十次消耗
    /// </summary>
    public int recruit_rmb_ten;
}

public class InitDataMgr
{
    public static Dictionary<long, InitData> Dict { get; private set; }

    public static void Load()
    {
        List<InitData> initRoles = StaticDataReader.LoadJsonFromFile<InitData>("static_init_data");
        if (initRoles != null)
        {
            Dict = new Dictionary<long, InitData>(initRoles.Count);
            for(int i=0; i<initRoles.Count; i++)
            {
                Dict.Add(initRoles[i].id, initRoles[i]);
            }
        }
        else
        {
            Dict = new Dictionary<long, InitData>();
        }
    }

    public static bool TryGet(out InitData initData)
    {
        return Dict.TryGetValue(1, out initData);
    }
}
